import React, { Component } from 'react'

// 处理 search 参数路由
// import qs from "querystring";

export default class Detail extends Component {
    render() {

        /*
            处理 params 参数路由 数据在props.match.params中
            const { id, title } = this.props.match.params
        */

        /*
            处理 search 参数路由 数据在props.location.search中 
            const { search } = this.props.location
            const newSearchData = search.slice(1)
            const result = qs.parse(newSearchData)
            const { id, title } = result
        */

        /* 处理state 参数路由 数据在props.location.state中 */
        const { id, title } = this.props.location.state || {}
        return (
            <div>
                <ul>
                    <li>编号：{id}</li>
                    <li>标题：{title}</li>
                </ul>
            </div>
        )
    }
}
